import React from "react";
import {Graph} from './Graph'
import Mockdata from "./Mockdata"



export default class GraphContainer extends React.Component {

    constructor(props){
        super(props)

        this.ref = React.createRef();

    }

    componentDidMount() {
        let options = {
            width: this.props.width,
            height: this.props.height
        }
        Graph.init(this.ref.current, options);
        var mock = new Mockdata();
        var data = mock.mock();
        Graph.data(data);
        Graph.render();
    }



    render() {
        return(
            <div style={{ backgroundColor: "#FFFFFF" }} ref={this.ref}></div>
        );
    }

    



}